import pandas as pd

data_frame = pd.DataFrame(
    {'color': ['white', 'red', 'green', 'red', 'green'], 'object': ['pen', 'pencil', 'pencil', 'ashtray', 'pen'],
     'price1': [5.56, 4.20, 1.30, 0.56, 2.75], 'price2': [4.75, 4.12, 1.60, 0.75, 3.15]})

print(data_frame)

# 对color进行分组，对price1进行聚合，返回最大值
price_max = data_frame.groupby(by='color')['price1'].max()
print(price_max)
